* {
	margin: 0;
	padding: 0;
	list-style: none;
}

.flip-container {
	width: 283px;
	height: 283px;
	margin: 0px auto;
	transition: transform .5s ease-in-out;
	position: relative;
	/*父类容器中 perspective 子类允许透视*/
	perspective: 1000px;
	/*使其子类变换后得以保留 3d转换后的位置*/
	transform-style: preserve-3d;
}

.front,
.back {
	width: 100%;
	height: 100%;
	/*背景不穿透，表示翻转后便看不到正面*/
	-webkit-backface-visibility: hidden;
	/*注意：safari浏览器必须用webkit前缀*/
	backface-visibility: hidden;
	transition: 0.6s ease-out;
	position: absolute;
	text-align: center;
	font-size: 30px;
	top: 0;
	left: 0;
}
.front{
	background: #0000FF;
}
.back{
	background: red;
}
.front img,
.back img {
	width: 283px;
	height: 283px;
	overflow: hidden;
}

.front {
	transform: rotateY(0deg);
}

.back {
	transform: rotateY(-180deg);
}

/*鼠标移动覆盖时，触发翻转*/
.flip-container:hover .back {
	transform: rotateY(0deg);
}

.flip-container:hover .front {
	transform: rotateY(180deg);
}

.flip-container:hover .back {
	animation: backRotate 2s linear both;
}

.flip-container:hover .front {
	animation: frontRotate 2s linear both;
}

@keyframes backRotate {

	0%,
	30% {
		transform: rotateY(-180deg);
	}

	15%,
	45% {
		transform: rotateY(-150deg);
	}

	100% {
		transform: rotateY(0deg);
	}
}

@keyframes frontRotate {

	0%,
	30% {
		transform: rotateY(0);
	}

	15%,
	45% {
		transform: rotateY(30deg);
	}

	100% {
		transform: rotateY(180deg);
	}
}
